Integrand size = 22, antiderivative size = 179 \[ \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx=\frac {(c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d^2 \text {arctanh}(\cos (a+b x))}{b^3}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}-\frac {i d (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}+\frac {i d (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}+\frac {d^2 \operatorname {PolyLog}\left (3,-e^{i (a+b x)}\right )}{b^3}-\frac {d^2 \operatorname {PolyLog}\left (3,e^{i (a+b x)}\right )}{b^3} \]
(d*x+c)^2*arctanh(exp(I*(b*x+a)))/b-d^2*arctanh(cos(b*x+a))/b^3-d*(d*x+c)* csc(b*x+a)/b^2-1/2*(d*x+c)^2*cot(b*x+a)*csc(b*x+a)/b-I*d*(d*x+c)*polylog(2 ,-exp(I*(b*x+a)))/b^2+I*d*(d*x+c)*polylog(2,exp(I*(b*x+a)))/b^2+d^2*polylo g(3,-exp(I*(b*x+a)))/b^3-d^2*polylog(3,exp(I*(b*x+a)))/b^3
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(471\) vs. \(2(179)=358\).
Time = 7.51 (sec) , antiderivative size = 471, normalized size of antiderivative = 2.63 \[ \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx=-\frac {d (c+d x) \csc (a)}{b^2}+\frac {\left (-c^2-2 c d x-d^2 x^2\right ) \csc ^2\left (\frac {a}{2}+\frac {b x}{2}\right )}{8 b}+\frac {-b^2 c^2 \log \left (1-e^{i (a+b x)}\right )+2 d^2 \log \left (1-e^{i (a+b x)}\right )-2 b^2 c d x \log \left (1-e^{i (a+b x)}\right )-b^2 d^2 x^2 \log \left (1-e^{i (a+b x)}\right )+b^2 c^2 \log \left (1+e^{i (a+b x)}\right )-2 d^2 \log \left (1+e^{i (a+b x)}\right )+2 b^2 c d x \log \left (1+e^{i (a+b x)}\right )+b^2 d^2 x^2 \log \left (1+e^{i (a+b x)}\right )-2 i b d (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )+2 i b d (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )+2 d^2 \operatorname {PolyLog}\left (3,-e^{i (a+b x)}\right )-2 d^2 \operatorname {PolyLog}\left (3,e^{i (a+b x)}\right )}{2 b^3}+\frac {\left (c^2+2 c d x+d^2 x^2\right ) \sec ^2\left (\frac {a}{2}+\frac {b x}{2}\right )}{8 b}+\frac {\sec \left (\frac {a}{2}\right ) \sec \left (\frac {a}{2}+\frac {b x}{2}\right ) \left (-c d \sin \left (\frac {b x}{2}\right )-d^2 x \sin \left (\frac {b x}{2}\right )\right )}{2 b^2}+\frac {\csc \left (\frac {a}{2}\right ) \csc \left (\frac {a}{2}+\frac {b x}{2}\right ) \left (c d \sin \left (\frac {b x}{2}\right )+d^2 x \sin \left (\frac {b x}{2}\right )\right )}{2 b^2} \]
-((d*(c + d*x)*Csc[a])/b^2) + ((-c^2 - 2*c*d*x - d^2*x^2)*Csc[a/2 + (b*x)/ 2]^2)/(8*b) + (-(b^2*c^2*Log[1 - E^(I*(a + b*x))]) + 2*d^2*Log[1 - E^(I*(a + b*x))] - 2*b^2*c*d*x*Log[1 - E^(I*(a + b*x))] - b^2*d^2*x^2*Log[1 - E^( I*(a + b*x))] + b^2*c^2*Log[1 + E^(I*(a + b*x))] - 2*d^2*Log[1 + E^(I*(a + b*x))] + 2*b^2*c*d*x*Log[1 + E^(I*(a + b*x))] + b^2*d^2*x^2*Log[1 + E^(I* (a + b*x))] - (2*I)*b*d*(c + d*x)*PolyLog[2, -E^(I*(a + b*x))] + (2*I)*b*d *(c + d*x)*PolyLog[2, E^(I*(a + b*x))] + 2*d^2*PolyLog[3, -E^(I*(a + b*x)) ] - 2*d^2*PolyLog[3, E^(I*(a + b*x))])/(2*b^3) + ((c^2 + 2*c*d*x + d^2*x^2 )*Sec[a/2 + (b*x)/2]^2)/(8*b) + (Sec[a/2]*Sec[a/2 + (b*x)/2]*(-(c*d*Sin[(b *x)/2]) - d^2*x*Sin[(b*x)/2]))/(2*b^2) + (Csc[a/2]*Csc[a/2 + (b*x)/2]*(c*d *Sin[(b*x)/2] + d^2*x*Sin[(b*x)/2]))/(2*b^2)
Time = 1.35 (sec) , antiderivative size = 324, normalized size of antiderivative = 1.81, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.545, Rules used = {4915, 3042, 4671, 3011, 2720, 4674, 3042, 4257, 4671, 3011, 2720, 7143}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx\) |
\(\Big \downarrow \) 4915 |
\(\displaystyle \int (c+d x)^2 \csc ^3(a+b x)dx-\int (c+d x)^2 \csc (a+b x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x)^2 \csc (a+b x)^3dx-\int (c+d x)^2 \csc (a+b x)dx\) |
\(\Big \downarrow \) 4671 |
\(\displaystyle \frac {2 d \int (c+d x) \log \left (1-e^{i (a+b x)}\right )dx}{b}-\frac {2 d \int (c+d x) \log \left (1+e^{i (a+b x)}\right )dx}{b}+\int (c+d x)^2 \csc (a+b x)^3dx+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}\) |
\(\Big \downarrow \) 3011 |
\(\displaystyle -\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {i d \int \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )dx}{b}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {i d \int \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )dx}{b}\right )}{b}+\int (c+d x)^2 \csc (a+b x)^3dx+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}\) |
\(\Big \downarrow \) 2720 |
\(\displaystyle -\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\int (c+d x)^2 \csc (a+b x)^3dx+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}\) |
\(\Big \downarrow \) 4674 |
\(\displaystyle -\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {d^2 \int \csc (a+b x)dx}{b^2}+\frac {1}{2} \int (c+d x)^2 \csc (a+b x)dx+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {d^2 \int \csc (a+b x)dx}{b^2}+\frac {1}{2} \int (c+d x)^2 \csc (a+b x)dx+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle -\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {1}{2} \int (c+d x)^2 \csc (a+b x)dx-\frac {d^2 \text {arctanh}(\cos (a+b x))}{b^3}+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}\) |
\(\Big \downarrow \) 4671 |
\(\displaystyle \frac {1}{2} \left (-\frac {2 d \int (c+d x) \log \left (1-e^{i (a+b x)}\right )dx}{b}+\frac {2 d \int (c+d x) \log \left (1+e^{i (a+b x)}\right )dx}{b}-\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}\right )-\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}-\frac {d^2 \text {arctanh}(\cos (a+b x))}{b^3}+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}\) |
\(\Big \downarrow \) 3011 |
\(\displaystyle \frac {1}{2} \left (\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {i d \int \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )dx}{b}\right )}{b}-\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {i d \int \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )dx}{b}\right )}{b}-\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}\right )-\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}-\frac {d^2 \text {arctanh}(\cos (a+b x))}{b^3}+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}\) |
\(\Big \downarrow \) 2720 |
\(\displaystyle \frac {1}{2} \left (\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}-\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}-\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}\right )-\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \int e^{-i (a+b x)} \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )de^{i (a+b x)}}{b^2}\right )}{b}-\frac {d^2 \text {arctanh}(\cos (a+b x))}{b^3}+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}\) |
\(\Big \downarrow \) 7143 |
\(\displaystyle -\frac {d^2 \text {arctanh}(\cos (a+b x))}{b^3}+\frac {1}{2} \left (-\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \operatorname {PolyLog}\left (3,-e^{i (a+b x)}\right )}{b^2}\right )}{b}-\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \operatorname {PolyLog}\left (3,e^{i (a+b x)}\right )}{b^2}\right )}{b}\right )+\frac {2 (c+d x)^2 \text {arctanh}\left (e^{i (a+b x)}\right )}{b}-\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b}-\frac {d \operatorname {PolyLog}\left (3,-e^{i (a+b x)}\right )}{b^2}\right )}{b}+\frac {2 d \left (\frac {i (c+d x) \operatorname {PolyLog}\left (2,e^{i (a+b x)}\right )}{b}-\frac {d \operatorname {PolyLog}\left (3,e^{i (a+b x)}\right )}{b^2}\right )}{b}-\frac {d (c+d x) \csc (a+b x)}{b^2}-\frac {(c+d x)^2 \cot (a+b x) \csc (a+b x)}{2 b}\) |
(2*(c + d*x)^2*ArcTanh[E^(I*(a + b*x))])/b - (d^2*ArcTanh[Cos[a + b*x]])/b ^3 - (d*(c + d*x)*Csc[a + b*x])/b^2 - ((c + d*x)^2*Cot[a + b*x]*Csc[a + b* x])/(2*b) - (2*d*((I*(c + d*x)*PolyLog[2, -E^(I*(a + b*x))])/b - (d*PolyLo g[3, -E^(I*(a + b*x))])/b^2))/b + (2*d*((I*(c + d*x)*PolyLog[2, E^(I*(a + b*x))])/b - (d*PolyLog[3, E^(I*(a + b*x))])/b^2))/b + ((-2*(c + d*x)^2*Arc Tanh[E^(I*(a + b*x))])/b + (2*d*((I*(c + d*x)*PolyLog[2, -E^(I*(a + b*x))] )/b - (d*PolyLog[3, -E^(I*(a + b*x))])/b^2))/b - (2*d*((I*(c + d*x)*PolyLo g[2, E^(I*(a + b*x))])/b - (d*PolyLog[3, E^(I*(a + b*x))])/b^2))/b)/2
3.2.14.3.1 Defintions of rubi rules used
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct ionOfExponentialQ[u, x] && !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ [{a, m, n}, x] && IntegerQ[m*n]] && !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) *(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.) *(x_))^(m_.), x_Symbol] :> Simp[(-(f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Simp[g*(m/(b*c*n*Log[F])) Int[(f + g*x)^( m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e , f, g, n}, x] && GtQ[m, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[csc[(e_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[- 2*(c + d*x)^m*(ArcTanh[E^(I*(e + f*x))]/f), x] + (-Simp[d*(m/f) Int[(c + d*x)^(m - 1)*Log[1 - E^(I*(e + f*x))], x], x] + Simp[d*(m/f) Int[(c + d*x )^(m - 1)*Log[1 + E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e, f}, x] && IG tQ[m, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_))^(m_), x_Symbo l] :> Simp[(-b^2)*(c + d*x)^m*Cot[e + f*x]*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (-Simp[b^2*d*m*(c + d*x)^(m - 1)*((b*Csc[e + f*x])^(n - 2)/(f^ 2*(n - 1)*(n - 2))), x] + Simp[b^2*d^2*m*((m - 1)/(f^2*(n - 1)*(n - 2))) Int[(c + d*x)^(m - 2)*(b*Csc[e + f*x])^(n - 2), x], x] + Simp[b^2*((n - 2)/ (n - 1)) Int[(c + d*x)^m*(b*Csc[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c , d, e, f}, x] && GtQ[n, 1] && NeQ[n, 2] && GtQ[m, 1]
Int[Cot[(a_.) + (b_.)*(x_)]^(p_)*Csc[(a_.) + (b_.)*(x_)]*((c_.) + (d_.)*(x_ ))^(m_.), x_Symbol] :> -Int[(c + d*x)^m*Csc[a + b*x]*Cot[a + b*x]^(p - 2), x] + Int[(c + d*x)^m*Csc[a + b*x]^3*Cot[a + b*x]^(p - 2), x] /; FreeQ[{a, b , c, d, m}, x] && IGtQ[p/2, 0]
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d , e, n, p}, x] && EqQ[b*d, a*e]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 545 vs. \(2 (165 ) = 330\).
Time = 1.20 (sec) , antiderivative size = 546, normalized size of antiderivative = 3.05
method | result | size |
risch | \(\frac {x^{2} d^{2} b \,{\mathrm e}^{3 i \left (x b +a \right )}+2 c d x b \,{\mathrm e}^{3 i \left (x b +a \right )}+c^{2} b \,{\mathrm e}^{3 i \left (x b +a \right )}+x^{2} d^{2} b \,{\mathrm e}^{i \left (x b +a \right )}+2 c d x b \,{\mathrm e}^{i \left (x b +a \right )}-2 i d^{2} x \,{\mathrm e}^{3 i \left (x b +a \right )}+c^{2} b \,{\mathrm e}^{i \left (x b +a \right )}-2 i d c \,{\mathrm e}^{3 i \left (x b +a \right )}+2 i d^{2} x \,{\mathrm e}^{i \left (x b +a \right )}+2 i d c \,{\mathrm e}^{i \left (x b +a \right )}}{b^{2} \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )^{2}}+\frac {i d^{2} \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}+\frac {d^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x^{2}}{2 b}+\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a^{2}}{2 b^{3}}-\frac {d^{2} \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) a^{2}}{2 b^{3}}-\frac {i c d \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {i c d \operatorname {polylog}\left (2, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {i d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b^{2}}-\frac {2 c d a \,\operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}+\frac {c^{2} \operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b}+\frac {d^{2} a^{2} \operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}-\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x^{2}}{2 b}-\frac {d c \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) x}{b}-\frac {d c \ln \left (1-{\mathrm e}^{i \left (x b +a \right )}\right ) a}{b^{2}}+\frac {d c \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) x}{b}+\frac {c d \ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right ) a}{b^{2}}-\frac {d^{2} \operatorname {polylog}\left (3, {\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}+\frac {d^{2} \operatorname {polylog}\left (3, -{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}-\frac {2 d^{2} \operatorname {arctanh}\left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}\) | \(546\) |
1/b^2/(exp(2*I*(b*x+a))-1)^2*(x^2*d^2*b*exp(3*I*(b*x+a))+2*c*d*x*b*exp(3*I *(b*x+a))+c^2*b*exp(3*I*(b*x+a))+x^2*d^2*b*exp(I*(b*x+a))+2*c*d*x*b*exp(I* (b*x+a))-2*I*d^2*x*exp(3*I*(b*x+a))+c^2*b*exp(I*(b*x+a))-2*I*d*c*exp(3*I*( b*x+a))+2*I*d^2*x*exp(I*(b*x+a))+2*I*d*c*exp(I*(b*x+a)))+I/b^2*d^2*polylog (2,exp(I*(b*x+a)))*x+1/2/b*d^2*ln(exp(I*(b*x+a))+1)*x^2+1/2/b^3*d^2*ln(1-e xp(I*(b*x+a)))*a^2-1/2/b^3*d^2*ln(exp(I*(b*x+a))+1)*a^2-I/b^2*c*d*polylog( 2,-exp(I*(b*x+a)))+I/b^2*c*d*polylog(2,exp(I*(b*x+a)))-I/b^2*d^2*polylog(2 ,-exp(I*(b*x+a)))*x-2/b^2*c*d*a*arctanh(exp(I*(b*x+a)))+1/b*c^2*arctanh(ex p(I*(b*x+a)))+1/b^3*d^2*a^2*arctanh(exp(I*(b*x+a)))-1/2/b*d^2*ln(1-exp(I*( b*x+a)))*x^2-1/b*d*c*ln(1-exp(I*(b*x+a)))*x-1/b^2*d*c*ln(1-exp(I*(b*x+a))) *a+1/b*d*c*ln(exp(I*(b*x+a))+1)*x+1/b^2*c*d*ln(exp(I*(b*x+a))+1)*a-d^2*pol ylog(3,exp(I*(b*x+a)))/b^3+d^2*polylog(3,-exp(I*(b*x+a)))/b^3-2/b^3*d^2*ar ctanh(exp(I*(b*x+a)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 970 vs. \(2 (161) = 322\).
Time = 0.31 (sec) , antiderivative size = 970, normalized size of antiderivative = 5.42 \[ \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx=\text {Too large to display} \]
1/4*(2*(b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2)*cos(b*x + a) - 2*(I*b*d^2*x + I*b*c*d + (-I*b*d^2*x - I*b*c*d)*cos(b*x + a)^2)*dilog(cos(b*x + a) + I*s in(b*x + a)) - 2*(-I*b*d^2*x - I*b*c*d + (I*b*d^2*x + I*b*c*d)*cos(b*x + a )^2)*dilog(cos(b*x + a) - I*sin(b*x + a)) - 2*(I*b*d^2*x + I*b*c*d + (-I*b *d^2*x - I*b*c*d)*cos(b*x + a)^2)*dilog(-cos(b*x + a) + I*sin(b*x + a)) - 2*(-I*b*d^2*x - I*b*c*d + (I*b*d^2*x + I*b*c*d)*cos(b*x + a)^2)*dilog(-cos (b*x + a) - I*sin(b*x + a)) - (b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2 - (b^2* d^2*x^2 + 2*b^2*c*d*x + b^2*c^2 - 2*d^2)*cos(b*x + a)^2 - 2*d^2)*log(cos(b *x + a) + I*sin(b*x + a) + 1) - (b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2 - (b^ 2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2 - 2*d^2)*cos(b*x + a)^2 - 2*d^2)*log(cos (b*x + a) - I*sin(b*x + a) + 1) + (b^2*c^2 - 2*a*b*c*d + (a^2 - 2)*d^2 - ( b^2*c^2 - 2*a*b*c*d + (a^2 - 2)*d^2)*cos(b*x + a)^2)*log(-1/2*cos(b*x + a) + 1/2*I*sin(b*x + a) + 1/2) + (b^2*c^2 - 2*a*b*c*d + (a^2 - 2)*d^2 - (b^2 *c^2 - 2*a*b*c*d + (a^2 - 2)*d^2)*cos(b*x + a)^2)*log(-1/2*cos(b*x + a) - 1/2*I*sin(b*x + a) + 1/2) + (b^2*d^2*x^2 + 2*b^2*c*d*x + 2*a*b*c*d - a^2*d ^2 - (b^2*d^2*x^2 + 2*b^2*c*d*x + 2*a*b*c*d - a^2*d^2)*cos(b*x + a)^2)*log (-cos(b*x + a) + I*sin(b*x + a) + 1) + (b^2*d^2*x^2 + 2*b^2*c*d*x + 2*a*b* c*d - a^2*d^2 - (b^2*d^2*x^2 + 2*b^2*c*d*x + 2*a*b*c*d - a^2*d^2)*cos(b*x + a)^2)*log(-cos(b*x + a) - I*sin(b*x + a) + 1) - 2*(d^2*cos(b*x + a)^2 - d^2)*polylog(3, cos(b*x + a) + I*sin(b*x + a)) - 2*(d^2*cos(b*x + a)^2 ...
\[ \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx=\int \left (c + d x\right )^{2} \cot ^{2}{\left (a + b x \right )} \csc {\left (a + b x \right )}\, dx \]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1938 vs. \(2 (161) = 322\).
Time = 0.53 (sec) , antiderivative size = 1938, normalized size of antiderivative = 10.83 \[ \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx=\text {Too large to display} \]
1/4*(c^2*(2*cos(b*x + a)/(cos(b*x + a)^2 - 1) + log(cos(b*x + a) + 1) - lo g(cos(b*x + a) - 1)) - 2*a*c*d*(2*cos(b*x + a)/(cos(b*x + a)^2 - 1) + log( cos(b*x + a) + 1) - log(cos(b*x + a) - 1))/b + a^2*d^2*(2*cos(b*x + a)/(co s(b*x + a)^2 - 1) + log(cos(b*x + a) + 1) - log(cos(b*x + a) - 1))/b^2 + 4 *(2*((b*x + a)^2*d^2 + 2*(b*c*d - a*d^2)*(b*x + a) - 2*d^2 + ((b*x + a)^2* d^2 + 2*(b*c*d - a*d^2)*(b*x + a) - 2*d^2)*cos(4*b*x + 4*a) - 2*((b*x + a) ^2*d^2 + 2*(b*c*d - a*d^2)*(b*x + a) - 2*d^2)*cos(2*b*x + 2*a) - (-I*(b*x + a)^2*d^2 + 2*(-I*b*c*d + I*a*d^2)*(b*x + a) + 2*I*d^2)*sin(4*b*x + 4*a) - 2*(I*(b*x + a)^2*d^2 + 2*(I*b*c*d - I*a*d^2)*(b*x + a) - 2*I*d^2)*sin(2* b*x + 2*a))*arctan2(sin(b*x + a), cos(b*x + a) + 1) + 4*(d^2*cos(4*b*x + 4 *a) - 2*d^2*cos(2*b*x + 2*a) + I*d^2*sin(4*b*x + 4*a) - 2*I*d^2*sin(2*b*x + 2*a) + d^2)*arctan2(sin(b*x + a), cos(b*x + a) - 1) + 2*((b*x + a)^2*d^2 + 2*(b*c*d - a*d^2)*(b*x + a) + ((b*x + a)^2*d^2 + 2*(b*c*d - a*d^2)*(b*x + a))*cos(4*b*x + 4*a) - 2*((b*x + a)^2*d^2 + 2*(b*c*d - a*d^2)*(b*x + a) )*cos(2*b*x + 2*a) - (-I*(b*x + a)^2*d^2 + 2*(-I*b*c*d + I*a*d^2)*(b*x + a ))*sin(4*b*x + 4*a) - 2*(I*(b*x + a)^2*d^2 + 2*(I*b*c*d - I*a*d^2)*(b*x + a))*sin(2*b*x + 2*a))*arctan2(sin(b*x + a), -cos(b*x + a) + 1) - 4*(I*(b*x + a)^2*d^2 + 2*b*c*d - 2*a*d^2 + 2*(I*b*c*d + (-I*a + 1)*d^2)*(b*x + a))* cos(3*b*x + 3*a) - 4*(I*(b*x + a)^2*d^2 - 2*b*c*d + 2*a*d^2 + 2*(I*b*c*d + (-I*a - 1)*d^2)*(b*x + a))*cos(b*x + a) - 4*(b*c*d + (b*x + a)*d^2 - a...
\[ \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \cot \left (b x + a\right )^{2} \csc \left (b x + a\right ) \,d x } \]
Timed out. \[ \int (c+d x)^2 \cot ^2(a+b x) \csc (a+b x) \, dx=\text {Hanged} \]